<template>
  <div id="app">
    <el-table
      :data="tableData"
      style="width: 100%"
      max-height="900">
      <el-table-column
        prop="id"
        label="id"
        width="150"
        align="center">
      </el-table-column>
      <el-table-column
        prop="score"
        label="得分"
        width="150"
        align="center">
      </el-table-column>
      <el-table-column
        prop="words"
        label="内容"
        width="400">
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import router from '../../router'
import axios from 'axios'

export default {
  name: 'History',
  data () {
    return {
      tableData: []
    }
  },
  methods: {
    getObj () {
      axios.get(`user/personal/queryComment`, {
        params: {}
      }).then(res => {
        if (res.data.status === 100) {
          this.tableData = res.data.data
        } else {
          alert('获取失败')
        }
      }).catch(err => {
        alert(err)
        router.replace('/index')
      })
    },
    handleClick (tab, event) {
      console.log(tab, event)
    }
  },
  created () {
    this.getObj()
  }
}
</script>

<style scoped>

</style>
